<?php
declare(strict_types=1);
/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://gitee.com/xmo/MineAdmin
 */
namespace App\Record\Request;

use Mine\MineFormRequest;

/**
 * 订单记录验证数据类
 */
class RecordPaymentOrderRequest extends MineFormRequest
{
    /**
     * 公共规则
     */
    public function commonRules(): array
    {
        return [];
    }

    
    /**
     * 新增数据验证规则
     * return array
     */
    public function saveRules(): array
    {
        return [
            //优惠券ID 验证
            'coupon_id' => 'required',
            //订单金额(分) 验证
            'money' => 'required',
            //折扣金额(分) 验证
            'discount' => 'required',
            //实付金额(分) 验证
            'fact_money' => 'required',
            //支付成功时间 验证
            'pay_time' => 'required',

        ];
    }
    /**
     * 更新数据验证规则
     * return array
     */
    public function updateRules(): array
    {
        return [
            //优惠券ID 验证
            'coupon_id' => 'required',
            //订单金额(分) 验证
            'money' => 'required',
            //折扣金额(分) 验证
            'discount' => 'required',
            //实付金额(分) 验证
            'fact_money' => 'required',
            //支付成功时间 验证
            'pay_time' => 'required',

        ];
    }

    
    /**
     * 字段映射名称
     * return array
     */
    public function attributes(): array
    {
        return [
            'id' => '',
            'user_id' => '用户ID',
            'coupon_id' => '优惠券ID',
            'money' => '订单金额(分)',
            'discount' => '折扣金额(分)',
            'fact_money' => '实付金额(分)',
            'method_id' => '支付方式',
            'biz_id' => '业务ID',
            'biz_type' => '业务类型1充值钻石',
            'pay_time' => '支付成功时间',
            'status' => '订单状态(0刚下单,1.已回调,2.支付成功,3.订单已关闭)',
            'created_by' => '所属代理',

        ];
    }

}